#!/bin/python3
#-*- coding: utf-8 -*-
# my_rum.py
# @author 刘秋
# @email lq@aqiu.info
# @description 
# @created 2020-04-04T09:03:16.540Z+08:00
# @last-modified 2020-04-04T09:50:14.814Z+08:00
#

import shutil
import os
import pandas as pd
import numpy as np

path = r"\\lqnas\Backups\dir1"
folder_path=os.path.join(path,"压缩包")
# print(folder_path)
files_list=["zip","rar","7z"]
if not os.path.exists(folder_path):
    os.makedirs(folder_path)

for root,dirs,files in os.walk(path,topdown=False):
    if not root == folder_path:
        for name in files:
            if name.split(".")[-1] in files_list:
                try:
                    shutil.move(os.path.join(root,name),folder_path)
                except shutil.Error:
                    print(os.path.join(root,name))
                    
            